package top.chatgqt.SmartChargeStation.utils;

import jakarta.annotation.Resource;
import org.apache.iotdb.isession.pool.SessionDataSetWrapper;
import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException;
import top.chatgqt.SmartChargeStation.service.IoTDBService;

import java.util.List;

public class IoTDBUtils {

    @Resource
    private IoTDBService service;

    /**
     * 根据自定义sql语句查询数据
     */
    SessionDataSetWrapper executeQueryStatement(String sql) throws IoTDBConnectionException, StatementExecutionException {
        return service.executeQueryStatement(sql);
    }

    /**
     * 根据时间查询数据
     */
    SessionDataSetWrapper executeRawDataQuery(List<String> paths, long startTime, long endTime, long TimeOut) throws IoTDBConnectionException, StatementExecutionException {
        return service.executeRawDataQuery(paths, startTime, endTime, TimeOut);
    }
}
